/*   1:    */ package tt.dz.web.controller.user;
/*   2:    */ 
/*   3:    */ import com.alibaba.fastjson.JSON;
/*   4:    */ import java.util.ArrayList;
/*   5:    */ import java.util.List;
/*   6:    */ import javax.annotation.Resource;
/*   7:    */ import javax.servlet.http.HttpServletRequest;
/*   8:    */ import javax.servlet.http.HttpServletResponse;
/*   9:    */ import org.springframework.stereotype.Controller;
/*  10:    */ import org.springframework.web.bind.annotation.RequestMapping;
/*  11:    */ import org.springframework.web.bind.annotation.ResponseBody;
/*  12:    */ import tt.dz.biz.service.user.OperRoleService;
/*  13:    */ import tt.dz.common.LogUtil;
/*  14:    */ import tt.dz.vo.OperListVO;
/*  15:    */ import tt.dz.vo.OperRoleVO;
/*  16:    */ import tt.dz.vo.ResponseModle;
/*  17:    */ import tt.dz.vo.RoleVO;
/*  18:    */ import tt.dz.web.controller.BaseController;
/*  19:    */ 
/*  20:    */ @Controller
/*  21:    */ public class OperRoleController
/*  22:    */   extends BaseController
/*  23:    */ {
/*  24:    */   @Resource(name="operRoleService")
/*  25:    */   private OperRoleService operRoleService;
/*  26:    */   
/*  27:    */   @RequestMapping(value={"/listAllOperRole"}, produces={"application/json;charset=UTF-8"})
/*  28:    */   @ResponseBody
/*  29:    */   public String listAllOperRole()
/*  30:    */   {
/*  31: 37 */     ResponseModle responseModle = null;
/*  32:    */     try
/*  33:    */     {
/*  34: 39 */       List<OperRoleVO> operRoleList = this.operRoleService.listAllOperRole();
/*  35: 40 */       responseModle = new ResponseModle("success", operRoleList);
/*  36:    */     }
/*  37:    */     catch (Exception e)
/*  38:    */     {
/*  39: 42 */       LogUtil.error("查询操作员角色关联异常", e);
/*  40: 43 */       responseModle = new ResponseModle("error", new ArrayList());
/*  41:    */     }
/*  42: 45 */     return JSON.toJSONString(responseModle);
/*  43:    */   }
/*  44:    */   
/*  45:    */   @RequestMapping(value={"/queryOperRoleByRole"}, produces={"application/json;charset=UTF-8"})
/*  46:    */   @ResponseBody
/*  47:    */   public String queryOperRoleByRole(HttpServletRequest request, HttpServletResponse response)
/*  48:    */   {
/*  49: 55 */     ResponseModle responseModle = null;
/*  50:    */     try
/*  51:    */     {
/*  52: 57 */       OperRoleVO operRoleVO = (OperRoleVO)JSON.parseObject(request.getParameter("roleVO"), OperRoleVO.class);
/*  53: 58 */       List<OperRoleVO> operRoleList = this.operRoleService.queryOperRoleByRole(operRoleVO);
/*  54: 59 */       responseModle = new ResponseModle("success", operRoleList);
/*  55:    */     }
/*  56:    */     catch (Exception e)
/*  57:    */     {
/*  58: 61 */       LogUtil.error("查询操作员角色关联异常", e);
/*  59: 62 */       responseModle = new ResponseModle("error", new ArrayList());
/*  60:    */     }
/*  61: 64 */     return JSON.toJSONString(responseModle);
/*  62:    */   }
/*  63:    */   
/*  64:    */   @RequestMapping(value={"/queryUnAllotRole"}, produces={"application/json;charset=UTF-8"})
/*  65:    */   @ResponseBody
/*  66:    */   public String queryUnAllotRole(HttpServletRequest request, HttpServletResponse response)
/*  67:    */   {
/*  68: 74 */     ResponseModle responseModle = null;
/*  69:    */     try
/*  70:    */     {
/*  71: 76 */       OperListVO operListVO = (OperListVO)JSON.parseObject(request.getParameter("operListVO"), OperListVO.class);
/*  72: 77 */       List<RoleVO> roleList = this.operRoleService.queryUnAllotRole(operListVO);
/*  73: 78 */       responseModle = new ResponseModle("success", roleList);
/*  74:    */     }
/*  75:    */     catch (Exception e)
/*  76:    */     {
/*  77: 80 */       LogUtil.error("查询操作员角色关联异常", e);
/*  78: 81 */       responseModle = new ResponseModle("error", new ArrayList());
/*  79:    */     }
/*  80: 83 */     return JSON.toJSONString(responseModle);
/*  81:    */   }
/*  82:    */   
/*  83:    */   @RequestMapping(value={"/queryOperRoleByOper"}, produces={"application/json;charset=UTF-8"})
/*  84:    */   @ResponseBody
/*  85:    */   public String queryOperRoleByOper(HttpServletRequest request, HttpServletResponse response)
/*  86:    */   {
/*  87: 93 */     ResponseModle responseModle = null;
/*  88:    */     try
/*  89:    */     {
/*  90: 95 */       OperListVO operListVO = (OperListVO)JSON.parseObject(request.getParameter("operListVO"), OperListVO.class);
/*  91: 96 */       List<OperRoleVO> operRoleList = this.operRoleService.queryOperRoleByOper(operListVO);
/*  92: 97 */       responseModle = new ResponseModle("success", operRoleList);
/*  93:    */     }
/*  94:    */     catch (Exception e)
/*  95:    */     {
/*  96: 99 */       LogUtil.error("查询操作员角色关联异常", e);
/*  97:100 */       responseModle = new ResponseModle("error", new ArrayList());
/*  98:    */     }
/*  99:102 */     return JSON.toJSONString(responseModle);
/* 100:    */   }
/* 101:    */   
/* 102:    */   @RequestMapping(value={"/modifyOperRole"}, produces={"application/json;charset=UTF-8"})
/* 103:    */   @ResponseBody
/* 104:    */   public String modifyOperRole(HttpServletRequest request, HttpServletResponse response)
/* 105:    */   {
/* 106:114 */     boolean excuteFlag = false;
/* 107:    */     try
/* 108:    */     {
/* 109:116 */       List<OperRoleVO> operRoleList = JSON.parseArray(request.getParameter("operRoleList"), OperRoleVO.class);
/* 110:117 */       String managerId = request.getParameter("managerId");
/* 111:118 */       excuteFlag = this.operRoleService.modifyOperRole(operRoleList, managerId);
/* 112:    */     }
/* 113:    */     catch (Exception e)
/* 114:    */     {
/* 115:120 */       LogUtil.error("更改操作员角色关联异常", e);
/* 116:    */     }
/* 117:122 */     return JSON.toJSONString(assemblyResponseData(excuteFlag, null));
/* 118:    */   }
/* 119:    */ }


/* Location:           F:\work\pengyu\mainServer\WEB-INF\classes\
 * Qualified Name:     tt.dz.web.controller.user.OperRoleController
 * JD-Core Version:    0.7.0.1
 */